<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/static/layui/css/layui.css">
</head>
<body>
<div id="assess">
<table class="layui-table">
  <thead>
    <tr>
      <th>考核项目</th>
      <th>分值</th>
      <th>得分</th>
    </tr> 
  </thead>
    <tbody>
    <c:forEach items="${data}" var="d">
    <tr>
      <td>${d.information.examination}</td>
      <td>${d.information.score}</td>
      <td><input id="${d.id }" type="text" onchange="tijiao(this.id,this.value)" class="layui-input" lay-verify="number" value="${d.grade}"></td>
    </tr>
    </c:forEach>
  </tbody>
</table>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/layui/layui.js"></script>
<script type="text/javascript">
function tijiao(id,grade){
	
	$.post("${pageContext.request.contextPath }/studentAssess/tijiao", {id:id, grades:grade },function(msg){
		if(msg!="无消息"){
			layui.use('layer', function(){
				  var layer = layui.layer;
				  layer.msg(msg,{
					  time: 4000
				  });
				});              
		}
	} );
}
</script>
</body>
</html>